<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Welcome extends MY_Controller {
	
	public function index($page = 1) {
		$page = (int) $page;
		if ($page <= 0) $page = 1;
		$page_size = 10;
		$this->load->model('post_model');
		$post_list = $this->post_model->get_simple_list($page, $page_size);
		$total_count = $this->post_model->get_simple_list_all_count();
		
		$this->page_data['nav_index'] = 1;
		$this->page_data['bread_crumb'] = array(
			array('label' => '首页')
		);
		$this->page_data['post_list'] = $post_list;
		$this->page_data['page'] = $page;
		$this->page_data['page_size'] = $page_size;
		$this->page_data['total_count'] = $total_count;
		$this->page_data['meta_content'] = $this->load->view('home/meta', $this->page_data, TRUE);
		$this->page_data['main_content'] = $this->load->view('home/main', $this->page_data, TRUE);
		$this->load->view('template/main', $this->page_data);
	}
	
	public function page_abnormal($page) {
		$page = (int) $page;
		if ($page <= 0) $page = 1;
		$page_size = 10;
		$this->load->model('post_model');
		$post_list = $this->post_model->get_abnormal_list($page, $page_size);
		$total_count = $this->post_model->get_abnormal_list_all_count();
		
		$this->page_data['nav_index'] = 1;
		$this->page_data['bread_crumb'] = array(
			array('label' => '首页', 'href' => site_url()),
			array('label' => '非正常研究所')
		);
		$this->page_data['post_list'] = $post_list;
		$this->page_data['page'] = $page;
		$this->page_data['page_size'] = $page_size;
		$this->page_data['total_count'] = $total_count;
		$this->page_data['meta_content'] = $this->load->view('home/meta', $this->page_data, TRUE);
		$this->page_data['main_content'] = $this->load->view('home/main', $this->page_data, TRUE);
		$this->load->view('template/main', $this->page_data);
	}
	
	public function page_signup() {
		$page_title = '注册';
		$this->page_data['nav_index'] = 4;
		$this->page_data['page_title'] = $page_title;
		$this->page_data['bread_crumb'] = array(
			array('label' => '首页', 'href' => site_url()),
			array('label' => $page_title)
		);
		$this->page_data['meta_content'] = $this->load->view('signup/meta', $this->page_data, TRUE);
		$this->page_data['main_content'] = $this->load->view('signup/main', $this->page_data, TRUE);
		$this->load->view('template/main', $this->page_data);
	}
	
	public function page_signin() {
		$page_title = '登录';
		$this->page_data['nav_index'] = 5;
		$this->page_data['page_title'] = $page_title;
		$this->page_data['bread_crumb'] = array(
			array('label' => '首页', 'href' => site_url()),
			array('label' => $page_title)
		);
		$this->page_data['meta_content'] = $this->load->view('signin/meta', $this->page_data, TRUE);
		$this->page_data['main_content'] = $this->load->view('signin/main', $this->page_data, TRUE);
		$this->load->view('template/main', $this->page_data);
	}
	
	public function page_contact() {
		$page_title = '联系我们';
		$this->page_data['nav_index'] = 7;
		$this->page_data['page_title'] = $page_title;
		$this->page_data['bread_crumb'] = array(
			array('label' => '首页', 'href' => site_url()),
			array('label' => $page_title)
		);
		$this->page_data['meta_content'] = $this->load->view('signin/meta', $this->page_data, TRUE);
		$this->page_data['main_content'] = $this->load->view('signin/main', $this->page_data, TRUE);
		$this->load->view('template/main', $this->page_data);
	}
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */